<?php

namespace app\api\controller;

use app\common\controller\Api;
use think\facade\Log;
/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页
     *
     */
    public function index()
    {
        $post= $this->request->post();
       /* $uid = $this->auth->id;
        $app_id = strtolower('wx'.encrypt('system'.'1','E','system'));
        $app_secret = base64_encode($app_id);
        print_r($app_id);
        TD($app_secret);
        TD(base64_decode($app_secret));*/

       /* $str = "app=fpv&stream=fcs1&type=play&auth_key=bGUvye8DHeym3/sVTD49vAfvvQ2zn9Hd1quT52+W5hblXw&session=88-88";
        if (preg_match("/&/", $str)) {
            $arr = explode("&",$str);
            $matches = preg_grep('/^auth_key=/', $arr);
            if (!empty($matches)) {
                TD(current($matches)); // 输出：auth_key=bGUvye8DHeym3/sVTD49vAfvvQ2zn9Hd1quT52+W5hblXw

            }
        } else {
            echo "字符串中不存在'&'字符";
        }*/

        customLog('app_test1',[
                                     'app' => 'fpv',
                                    'hook_index' => 7,
                                    'id' => '820-46',
                                    'ip' => '192.168.0.151',
                                    'mediaServerId' => 'fpv_live_sever_01',
                                    'originType' => 1,
                                    'originTypeStr' => 'rtmp_push',
                                    'params' => 'auth_key=7H22usva6yEcL9oAXZ5fE/3q76S9yvSJYM4M1j1HUAPPp+Mm3g',
                                    'port' => 25190,
                                    'protocol' => 'rtmp',
                                    'schema' => 'rtmp',
                                    'stream' => 'fcs1',
                                    'vhost' => '__defaultVhost__',
                            ],'new');

        $this->success('请求成功',$post);
    }


}
